/*
 *  Copyright 2008-2010 www.jrails.org
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.rails.extjs.panel.grid;

import org.rails.extjs.Template;
import org.rails.extjs.javascript.Function;

public class PivotGridView extends GridView {

	public PivotGridView() {
		super();
	}
	
	public void setGetCellCls(Function getCellCls){
		addOption("getCellCls",getCellCls);
	}
	
	public Function getGetCellCls(){
		return (Function)getOption("getCellCls");
	}
	
	public void setTitle(String title){
		addOption("title",title);
	}
	
	public String getTitle(){
		return getString("title","");
	}
	
	public void setTemplate(Template template){
		addOption("template", template);
	}
	
	public Template getTemplate(){
		return (Template)getOption("template");
	}
	
	public void setColHeaderCellCls(String colHeaderCellCls){
		addOption("colHeaderCellCls",colHeaderCellCls);
	}
	
	public String getColHeaderCellCls(){
		return getString("colHeaderCellCls","grid-hd-group-cell");
	}
	
	public void setHeaderTitleEl(String headerTitleEl){
		addOption("headerTitleEl",headerTitleEl);
	}
	
	public String getHeaderTitleEl(){
		return getString("headerTitleEl","");
	}
	
	public void setRowHeadersEl(Object rowHeadersEl){
		addOption("rowHeadersEl", rowHeadersEl);
	}
	
	public Object getRowHeadersEl(){
		return getOption("rowHeadersEl");
	}
	
	@Override
	public String getScript() {
		script = new StringBuffer("");
		createItems();
		script.append("new Ext.grid.PivotGridView(");
		script.append(createOptions());
		script.append(")");
		return script.toString();
	}

}
